﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using OpenFrameworkCore.Controls;
using System.Collections.ObjectModel;

namespace OpenFrameworkTest
{
    public partial class Page : UserControl
	{
		ObservableCollection<BasicControlContext> controlBaseContexts =
			new ObservableCollection<BasicControlContext>();

        public Page()
        {
            InitializeComponent();

            BasicControlContainerContext context = new BasicControlContainerContext();
            context.ControlContexts = controlBaseContexts;

			controlContainer.ControlContainerContext = context;
        }

		private void AddControlButton_Click(object sender, RoutedEventArgs e)
		{
			BasicControlContext controlContext = new BasicControlContext()
			{
				ControlClass = new SimpleControl().GetType().AssemblyQualifiedName,
				Width = 200,
				Height = 200,
				X = 100,
				Y = 100,
				Angle = 0,
				ZIndex = 10,
				Opacity = 0.5
			};

			controlBaseContexts.Add(controlContext);
		}
    }
}
